package com.zkthink.ceres.product.dao;

import com.zkthink.base.mapper.SuperMapper;
import com.zkthink.ceres.product.entity.ProductAttr;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * 商品规格表
 * </p>
 *
 * @author JustArgo
 * @date 2020-05-07
 */
@Repository
public interface ProductAttrMapper extends SuperMapper<ProductAttr> {
    /** 根据id删除规格
     * @author JustArgo 2020/5/9 9:18
     * @return
     */
    int delAttrById(Long id);

    /** 根据商品id查询商品的规格
     * @author JustArgo 2020/5/10 18:10
     * @return
     */
    List<ProductAttr> selectByProductId(Long productId);

    /** 删除规格
     * @author JustArgo 2020/5/30 10:41
     * @return
     */
    List<Long> selectDeletedAttrIdByCondition(@Param("productId")Long productId, @Param("idList")List<Long> idList);

    /** 根据规格id列表 删除对象
     * @author JustArgo 2020/5/30 17:32
     * @return
     */
    int delByAttrIdList(List<Long> deletedAttrIdList);
}
